var tk = function VL(a) {
    var b = a.trim();

    return TL(b);

    //测试1 //"http://translate.google.cn/translate_a/single?client=t&sl=en&tl=zh-CN&hl=zh-CN&dt=bd&dt=ex&dt=ld&dt=md&dt=qc&dt=rw&dt=rm&dt=ss&dt=t&dt=at&ie=UTF-8&oe=UTF-8&source=sel&tk=96497.478341&q=测试"

    //测试2
    //"http://translate.google.cn/translate_a/single?client=t&sl=en&tl=zh-CN&hl=zh-CN&dt=bd&dt=ex&dt=ld&dt=md&dt=qc&dt=rw&dt=rm&dt=ss&dt=t&dt=at&ie=UTF-8&oe=UTF-8&source=sel&tk=968488.586588&q=happy new year!"
    //返回的结果
    //[[["新年快乐！","happy new year!",,,1],[,,"Xīnnián kuàilè!"]],[["感叹词",["恭贺新禧!","新年好!"],[["恭贺新禧!",["Happy New Year!"]],["新年好!",["Happy New Year!"]]],"Happy New Year!",9]],"en",,,[["happy new year!",32000,[["新年快乐！",0,true,false]],[[0,15]],"happy new year!",0,0]],0.61467338,,[["en"],,[0.61467338]],,,,,,[["Happy New Year!","happy","new","year","new year"]]]
}
//Google TK参数
//通过抓包分析http://translate.google.cn的访问，发现其中有一个tk参数比较难搞，无奈之下，硬着头皮分析混淆过的js代码，生成tk的js链接为desktop_module_main.js
//http://translate.google.cn/translate/releases/twsfe_w_20151214_RC03/r/js/desktop_module_main.js
//https://www.zhanghuanglong.com/detail/google-translate-tk-generation-and-parameter-details
function TL(a) {
    var k = "";
    var b = 406644;
    var b1 = 3293161072;

    var jd = ".";
    var $b = "+-a^+6";
    var Zb = "+-3^+b+-f";

    for (var e = [], f = 0, g = 0; g < a.length; g++) {
        var m = a.charCodeAt(g);
        128 > m ? e[f++] = m : (2048 > m ? e[f++] = m >> 6 | 192 : (55296 == (m & 64512) && g + 1 < a.length && 56320 == (a.charCodeAt(g + 1) & 64512) ? (m = 65536 + ((m & 1023) << 10) + (a.charCodeAt(++g) & 1023),
            e[f++] = m >> 18 | 240,
            e[f++] = m >> 12 & 63 | 128) : e[f++] = m >> 12 | 224,
            e[f++] = m >> 6 & 63 | 128),
            e[f++] = m & 63 | 128)
    }
    a = b;
    for (f = 0; f < e.length; f++) a += e[f],
        a = RL(a, $b);
    a = RL(a, Zb);
    a ^= b1 || 0;
    0 > a && (a = (a & 2147483647) + 2147483648);
    a %= 1E6;
    return a.toString() + jd + (a ^ b)
};

function RL(a, b) {
    var t = "a";
    var Yb = "+";
    for (var c = 0; c < b.length - 2; c += 3) {
        var d = b.charAt(c + 2),
            d = d >= t ? d.charCodeAt(0) - 87 : Number(d),
            d = b.charAt(c + 1) == Yb ? a >>> d: a << d;
        a = b.charAt(c) == Yb ? a + d & 4294967295 : a ^ d
    }
    return a
}
